<template>
	<view class="item-info" :class="showBillInfo === 0 ? 'none' : showBillInfo === 1 ? 'show' : ''">
		<view class="cate-content">
			<view class="item-fixed-top">
				<view class="title">收款</view>
				<view class="close" @click="closeBillInfo">
					<image src="../../static/images/close.png" mode="scaleToFill"></image>
				</view>
			</view>
			<view class="data-box">
				<view class="data-a">
					<view class="a-a">
						<view class="a-name">小美</view>
						<view class="a-gender">老板娘</view>
					</view>
					<view class="a-b">
						本单欠款(<text>45561</text>)
					</view>
				</view>
				<view class="data-b">
					<view class="b-a">收款金额<text class="money">2000</text></view>
					<view class="b-b">收款账号<text>现金账户</text></view>
					<view class="b-c">收款时间<text>2021/1/6</text></view>
				</view>
				<view class="data-c">
					<view class="c-a">客户余额<text>2021/1/6</text>  <switch checked @change="switch1Change" /> </view>
				</view>
				<view class="data-d">
					<view class="d-a">开单门店<text>白云店</text></view>
					<view class="d-a">出库仓库<text>暂不出库</text></view>
				</view>
				<view class="data-e">
					<view class="e-a">备注<text></text></view>
				</view>
				<view class="data-f">
					<view class="f-a">取消</view>
					<view class="f-b">确定</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showBillInfo : 0,
			};
		},
		
		methods: {
			//显示分类面板
			toggleBillsStateMask(type) 
			{	
				let timer = type === 'show' ? 10 : 200;
				let state = type === 'show' ? 1 : 0;
				this.showBillInfo = 2;
				setTimeout(() => {
					this.showBillInfo = state;
				}, timer);
			},
			
			closeBillInfo()
			{
				this.$emit("clickClose");
			},
			
			switch1Change(e) {
				console.log('switch1 发生 change 事件，携带值为', e.target.value);
			},
		}
	}
</script>
<style lang="scss">
	.item-info {
		position: fixed;
		z-index: 999;
		left: 0;
		top: 0;
		bottom: 0;
		width: 100%;
		background: rgba(0, 0, 0, 0);
		transition: 0.3s;
		overflow-y: hidden;
		display: flex;
		align-items: center;
		justify-content: center;
		.cate-content {
			border-radius: 6px;
			overflow: hidden;
			width: 60%;
			background: #F8F8F8;
			float: right;
			transform: translateY(-100%);
			transition: 0.3s;
			.item-fixed-top
			{
				padding: 10px;
				display: flex;
				align-items: center;
				justify-content: space-between;
				background: #FFF;
				font-size: 18px;
				.close
				{
					width: 32px;
					height: 32px;
					text-align: center;
					image
					{
						width: 14px;
						height: 14px;
					}
				}
			}
		}
	
		&.none {
			display: none;
		}
		&.show {
			background: rgba(0, 0, 0, 0.3);
			.cate-content {
				transform: translateY(0);
			}
		}
	}
	.data-box
	{
		font-size: 14px;
		.data-a
		{
			padding: 10px;
			.a-a
			{
				display: flex;
				.a-gender
				{
					padding-left: 12px;
				}
			}
			.a-b
			{
				text
				{
					color: red;
					font-weight: 700;
					font-size: 16px;
				}
			}
		}
		.data-b ,.data-c ,.data-d ,.data-e
		{
			background: #FFF;
			.b-a,.b-b,.b-c,.c-a,.d-a,.d-b,.e-a
			{
				padding:0 10px;
				border-bottom: 1px solid #ECECEC;
				line-height: 50px;
				text
				{
					padding-left: 20px;
					color: #999;
				}
				.money
				{
					color: #000;
					font-weight: 700;
					font-size: 16px;
				}
				switch
				{
					float: right;
				}
			}
		}
		.data-c ,.data-d ,.data-e
		{
			margin-top: 10px;
		}
		.data-f
		{
			margin-top: 20px;
			padding: 10px 0px;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			.f-a,.f-b
			{
				margin-right: 10px;
				padding: 6px 40px;
				border-radius: 6px;
				border: 1px solid #CCC;
			}
			.f-b
			{
				background: #007AFF;
				color: #FFF;
			}
		}
	}
</style>